Global Index
HTML5 JS API Index > Canvas Tutorials & Specs

HTMLCanvasElement

Extends HTMLElement.

The canvas element provides scripts with a resolution-dependent bitmap canvas, which can be used for rendering graphs, game graphics, art, or other visual images on the fly.

Properties
unsigned long
height
The width and height IDL attributes must reflect the respective content attributes of the same name, with the same defaults.
unsigned long
width
The width and height IDL attributes must reflect the respective content attributes of the same name, with the same defaults.
Operations
RenderingContext?
getContext(DOMString contextId, any arguments...)
The getContext(contextId, arguments...) method of the canvas element, when invoked, must run the steps in the cell of the following table whose column header describes the canvas element's canvas context mode and whose row header describes the method's first argument.
boolean
probablySupportsContext(DOMString contextId, any arguments...)
The probablySupportsContext(contextId, arguments...) method of the canvas element, when invoked, must return false if calling getContext() on the same object and with the same arguments would definitely return null at this time, and true otherwise.
voidsetContext(RenderingContext context)
voidtoBlob(FileCallback? _callback, optional DOMString type, any arguments...)
DOMStringtoDataURL(optional DOMString type, any arguments...)
CanvasProxytransferControlToProxy()
Referenced by
CanvasRenderingContext2DdrawImage(...)
ImageBitmapFactoriescreateImageBitmap(...)
WebGLRenderingContextBasecanvas